<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class Qh_KnowledgeRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'qlId' => 'bail|nullable|integer|exists:qh_question_libraries,id',
            'courseId' => 'bail|nullable|integer|exists:qh_courses,id',
            'parentId' => 'bail|nullable|integer|exists:qh_knowledge,id',
            'level' => 'bail|nullable|integer|in:1,2',
            'kaoshiMode' => 'bail|nullable|integer|in:1,2',
            'kaoshiScore' => 'bail|nullable|integer',
            'kaoshiSeconds' => 'bail|nullable|integer',
            'name' => 'bail|required|string',
            'questionCount' => 'bail|nullable|integer',
            'sort' => 'bail|nullable|integer',
        ];
    }
}
